﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="d" uri="/WEB-INF/resource.tld"%>

<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>
<sec:authentication property="principal" var="currentPrincipal" scope="page" />

<fmt:setBundle basename="ApplicationMessage" />
<fmt:setLocale value="zh_CN" />

<!DOCTYPE html>
<html lang="zh-CN">
<head>

<%@ include file="/WEB-INF/include/meta.jsp"%>
<%@ include file="/WEB-INF/include/css.jsp"%>

</head>

<body>

	<%@ include file="/WEB-INF/include/header.jsp"%>

	<%@ include file="/WEB-INF/include/menu.jsp"%>

	<div class="container main-content">

		<div class="panel panel-default x-panel x-panel-layout">

			<div class="panel-heading">
				<ol class="breadcrumb">
					<li><a href="${ctx.host}/ecommerce">电商管理</a></li>
					<li class="active">课程排期</li>
					<li class="no-before pull-right" style="min-width: 65px;"><a onclick="window.history.back();"><i class="glyphicon glyphicon-arrow-left"></i>&nbsp;&nbsp;返回</a></li>
				</ol>
			</div>

			<div class="panel-body">

				<div class="col-xs-2 x-panel-layout-left no-horizontal-padding">
					<%@ include file="/WEB-INF/include/submenu.jsp"%>
				</div>

				<div class="col-xs-10 x-panel-layout-right">

					<div class="x-breadcrumb-wrapper">
						<div class="x-breadcrumb clearfix">
							<h2>
								<i class="glyphicon glyphicon-fire" title="1v1课程详情"></i>&nbsp;&nbsp;<span>课程排期&nbsp;-&nbsp;1v1课程详情</span>
							</h2>
							<c:if test="${not empty courseRound.fitnessGroup}">
								<div class="pull-right">
									<a href="${ctx.host}/${pagetype}-rounds/${courseRound.id}/print?generated=false" class="btn btn-success x-btn btn-shadow btn-shadow-success ">打印课件</a> <a href="${ctx.host}/${pagetype}-rounds/${courseRound.id}/print?generated=true" class="btn btn-success x-btn btn-shadow btn-shadow-success ">打印已发送课件</a>
								</div>
							</c:if>
						</div>
					</div>

					<div class="x-breadcrumb-wrapper" style="margin-top: 20px;">

						<div class="x-breadcrumb-wrapper top-margin-20" style="position: relative;">
							<ul class="nav nav-pills x-breadcrumb-nav">
								<li class="pull-left active"><a href="${ctx.host}/${pagetype}-rounds/${courseRound.id}">基本信息</a></li>
								<c:if test="${not empty courseRound.fitnessGroup}">
									<li class="pull-left"><a href="${ctx.host}/${pagetype}-rounds/${courseRound.id}/batch-coursewares/weekly-plan/1">周计划</a></li>
									<li class="pull-left"><a href="${ctx.host}/${pagetype}-rounds/${courseRound.id}/batch-coursewares/1?type=course">课程</a></li>
								</c:if>
								<c:if test="${!courseRound.courseStatus.prepare}">
									<li class="pull-left"><a href="${ctx.host}/${pagetype}-rounds/${courseRound.id}/physical-data">身体数据</a></li>
								</c:if>
								<c:if test="${courseRound.roundCoursewareStatus.editing or courseRound.roundCoursewareStatus.finish}">
									<li class="pull-left"><a href="${ctx.host}/${pagetype}-rounds/${courseRound.id}/basic-information">学员基础信息</a></li>
									<c:if test="${not empty resultReport}">
										<li class="pull-left"><a href="${ctx.host}/${pagetype}-rounds/${courseRound.id}/result-report">成果报告</a></li>
									</c:if>
								</c:if>
							</ul>
						</div>

						<%-- <div class="x-breadcrumb yellow clearfix">
              <h2>
                <span>基本信息</span>
              </h2>
              <a href="${ctx.host}/${pagetype}-rounds/${courseRound.id}/schedules/create" data-target="#schedule-create" data-toggle="modal" style="position: absolute; right: 0px; top: 10px;">增加课程</a>
            </div>
          </div>  --%>

						<div class="clearfix">

							<div class="form-horizontal x-form-horizontal" style="width: 45%; float: left">
								<div class="form-group">
									<label class="control-label col-xs-4 text-right">课程名称：</label>
									<div class="col-xs-6">
										<p class="form-control-static">${courseRound.course.name}</p>
									</div>
								</div>
								<div class="form-group">
									<label class="control-label col-xs-4 text-right">课程周期：</label>
									<div class="col-xs-6">
										<p class="form-control-static">${courseRound.course.weeks}周${courseRound.course.hours}课时</p>
									</div>
								</div>
								<div class="form-group">
									<label class="control-label col-xs-4 text-right">课程地点：</label>
									<div class="col-xs-6">
										<p class="form-control-static">${courseRound.site.name}</p>
									</div>
								</div>
								<div class="form-group">
									<label class="control-label col-xs-4 text-right">教练名称：</label>
									<div class="col-xs-6">
										<p class="form-control-static">${courseRound.coach.name}</p>
									</div>
								</div>
								<div class="form-group">
									<label class="control-label col-xs-4 text-right">学员名称：</label>
									<div class="col-xs-6">
										<p class="form-control-static">${courseRound.student.name}</p>
									</div>
								</div>
								<div class="form-group">
									<label class="control-label col-xs-4 text-right">学员手机：</label>
									<div class="col-xs-6">
										<p class="form-control-static">${courseRound.student.mobile}</p>
									</div>
								</div>
								<div class="form-group">
									<label class="control-label col-xs-4 text-right">学员标签：</label>
									<div class="col-xs-6">
										<p class="form-control-static">新学员/基础组学员/年卡会员</p>
									</div>
								</div>

							</div>

							<div class="pull-right" style="width: 55%;">
								<table class="table table-striped table-hover x-table schedule-table" data-toggle="table">
									<thead>
										<tr>
											<th>日期</th>
											<th>时间段</th>
											<th>状态</th>
											<th>教练</th>
											<th>门店</th>
											<th class="text-center">操作</th>
										</tr>
									</thead>
									<tbody>
										<c:forEach var="schedule" items="${courseRound.schedules}">
											<tr>
												<td><fmt:formatDate value="${schedule.occurDate}" pattern="yyyy-MM-dd" /></td>
												<td>${schedule.occurHour}</td>
												<td>${schedule.scheduleStatus.description}</td>
												<td>${schedule.coach.name}</td>
												<td>${schedule.site.name}</td>
												<td class="text-center"><c:if test="${not currentPrincipal.coursewareManager and not currentPrincipal.coursewareMonitor}">
														<c:choose>
															<c:when test="${courseRound.courseStatus.hold and schedule.scheduleStatus.ready}">
																<a href="${ctx.host}/${pagetype}-rounds/${courseRound.id}/schedules/${schedule.id}/cancel" class="hover-no-text-decoration" data-toggle="modal" data-target="#schedule-cancel" title="取消">取消</a>&nbsp;&nbsp;
                          </c:when>
															<c:when test="${courseRound.courseStatus.ready and schedule.scheduleStatus.ready}">
																<%-- <c:if test="${currentPrincipal.admin || currentPrincipal.root}"> --%>
																<a href="${ctx.host}/${pagetype}-rounds/${courseRound.id}/schedules/${schedule.id}/edit" data-toggle="modal" data-target="#edit-schedule">修改课程</a>
																<%-- </c:if> --%>
															</c:when>
															<c:when test="${courseRound.courseStatus.ready and schedule.scheduleStatus.expiry}">
																<c:choose>
																	<c:when test="${courseRound.courseType.year}">
																		<c:if test="${currentPrincipal.admin || currentPrincipal.root || currentPrincipal.specialSite}">
																			<a href="${ctx.host}/expiry-schedules/${schedule.id}/time" class="hover-no-text-decoration" data-toggle="modal" data-target="#expiry-schedule-time" title="重新排课">重新排课</a>&nbsp;&nbsp;
                                </c:if>
																	</c:when>
																	<c:otherwise>
																		<a href="${ctx.host}/expiry-schedules/${schedule.id}/time" class="hover-no-text-decoration" data-toggle="modal" data-target="#expiry-schedule-time" title="重新排课">重新排课</a>&nbsp;&nbsp;
                              </c:otherwise>
																</c:choose>
																<c:if test="${currentPrincipal.root || currentPrincipal.admin || currentPrincipal.areaServer || currentPrincipal.specialSite }">
																	<a href="${ctx.host}/expiry-schedules/${schedule.id}/finished" class="hover-no-text-decoration" data-toggle="modal" data-target="#expiry-schedule-finish" title="已上课">已上课</a>
																</c:if>
															</c:when>
															<c:otherwise>
                            -
                          </c:otherwise>
														</c:choose>
													</c:if></td>
											</tr>
										</c:forEach>
									</tbody>
								</table>
							</div>
						</div>

					</div>

				</div>

			</div>

		</div>
	</div>

	<%@ include file="/WEB-INF/include/script.jsp"%>
	<d:resource root="${ctx.resource}/build" type="script" src="js/page/course/individual-round-view.js">
		<script type="text/javascript">
      require(['page/course/individual-round-view'], function(page) {
        page.init({
        	'roundId' : '${courseRound.id}'
        })
      })
    </script>
	</d:resource>

</body>

</html>
